<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/page.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<title>友着</title>
</head>
<body>
	<jsp:include page="navigation.jsp"></jsp:include>
	<div class="container" style="margin-left: 190px;">
		<div class="topbar-inner">
			<div class="myhead">
				<span class="crumb-name">举报信息</span>
			</div>
		</div>
		<form id="pageForm" action="accuseinfo" method="post">
			<div class="topbar-inner">
			</div>
			<div style="margin: 20px 20px 20px 20px; text-align: center;">
				<table class="table table-bordered table-hover table-striped">
					<thead>
						<tr>
							<th>被举报人</th>
							<th>举报人</th>
							<th>举报内容</th>
							<th>举报时间</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${ list }" var="l">
							<tr>
								<td>${ l.user.user_name }</td>
								<td>${ l.to_user.user_name }</td>
								<td>${ l.content }</td>
								<td><fmt:formatDate value="${ l.addtime }" pattern="yyyy-MM-dd HH:mm:ss" type="date" dateStyle="long" /></td>
								<td><c:if test="${ l.user.is_seale == 0 }">
										<a href="javascript:" onclick="toseale(${ l.user.id},1,'你确定要封号？')">
											暂时封号 
										</a>
										&emsp;|&emsp;
										<a href="javascript:" onclick="toseale(${ l.user.id},2,'你确定要封号？')">
											永久封号 
										</a>
									</c:if> 
									<c:if test="${ l.user.is_seale  == 1 }">
										<a href="javascript:" onclick="toseale(${ l.user.id },0,'你确定要解封？')">
											解封 </a>
									</c:if> 
									<c:if test="${ l.user.is_seale == 2 }">
										已永久封号 
									</c:if> 
								</td>
							</tr>
						</c:forEach>

					</tbody>
				</table>
				<input type="hidden" value="${ page.pageCount }" id="pageCount"
					name="pageCount" /> <input type="hidden"
					value="${ page.pageIndex }" id="pageIndex" name="pageIndex" />
				<c:if test="${ page == null }">
					<div style="font-size: larger;">暂无数据</div>
				</c:if>
				<c:if test="${ page != null && page.pageCount > 1 }">
					<ul id="pagination" class="pagination">

					</ul>
					<script type="text/javascript">
						setPage(document.getElementById("pagination"),
								parseInt($("#pageCount").val()), parseInt($(
										"#pageIndex").val()));
					</script>
				</c:if>
			</div>
		</form>
	</div>
	<script>
		$(function() {
			$('.submenu_2_5').addClass('submenu_native');
		});

		function toseale(userid, seale,message) {
			if (confirm(message)) {
				$.ajax({
					type : 'post',
					url : 'userseale',
					data : {userid: userid,seale:seale},
					success : function(data) {
						console.log(data);
						if (data != null) {
							if (data.code == 0) {
								alert('操作成功！');
								window.location.reload();
							} else {
								alert(data.message);
							}
						}
					}
				});
			}
			
		}
	</script>
</body>

</html>